Skip to content

feat: add style.menu dropdown style overrides to PromptInput#4708

Draft
ernst-dev wants to merge 2 commits into
mainfrom
dev-v3-ernstka-prompt-input-menu-styling
Draft

feat: add style.menu dropdown style overrides to PromptInput#4708
ernst-dev wants to merge 2 commits into
mainfrom
dev-v3-ernstka-prompt-input-menu-styling

Conversation

@ernst-dev

@ernst-dev ernst-dev commented Jul 9, 2026

Copy link
Copy Markdown
Member

Description

Extends PromptInput's style prop with a style.menu sub-object so consumers can theme the trigger-based command/shortcuts dropdown (the menu shown when a trigger character is typed) to match a custom design system.

PromptInputProps.Style.menu adds four overrides: backgroundColor, borderColor, borderRadius, and borderWidth. Each maps to a CSS custom property in getPromptInputStyles(). The value is threaded through InternalPromptInputTokenMode and reuses the internal Dropdown's existing DropdownProps.Style API. (DropdownProps.Style names the fill background; the bridge to backgroundColor is in token-mode.tsx.) The API is annotated @awsuiSystem core.

A dev page for visual testing is included: pages/prompt-input/menu-style.page.tsx.

Related links, issue #, if available: n/a

How has this been tested?

src/prompt-input/__tests__/styles.test.tsx covers the style → CSS-custom-property mapping and the Core-only gating (2/2 passing locally). The dev page menu-style.page.tsx was used for manual visual verification of the dropdown styling overrides.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

ernst-dev added 2 commits July 9, 2026 09:39
Adds a new `style.menu` sub-object to `PromptInputProps.Style` that
lets design-system consumers (e.g. Horizon-Rhythm-Core) override the
visual appearance of the trigger-based menus/shortcuts dropdown.

New style properties:
  - style.menu.backgroundColor  -> dropdown content-wrapper background
  - style.menu.borderColor      -> dropdown border colour
  - style.menu.borderRadius     -> dropdown border radius
  - style.menu.borderWidth      -> dropdown border width

Implementation:
  - 4 new custom CSS properties added to the generator list
  - getPromptInputStyles() maps them onto the root element as CSS vars
  - InternalPromptInput threads style.menu down to TokenMode
  - TokenMode builds a DropdownProps.Style and passes it to Dropdown
  - Existing Dropdown style API (dropdownContentBorder* CSS vars) reused
  - Unit tests updated; dev page added (menu-style.page.tsx)
Remove per-property JSDoc that restated prop names (inconsistent with sibling root/placeholder style sub-objects) and a redundant internal prop comment. Keep the public menu block doc + @awsuiSystem core tag, and add a short note on the DropdownProps.Style background<-backgroundColor bridge.
@ernst-dev ernst-dev changed the title feat(prompt-input): add style.menu dropdown style overrides feat: add style.menu dropdown style overrides to PromptInput Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant